<?
require_once "../php/Context.php";
require_once "../php/AdminInit.php";
if(!$admin->isAuthorize())
    echo "<script>document.location.href='../Admin.php';</script>";
?>
<!DOCTYPE HTML>
<html lang="en" ng-app="MainModule">
<head>
    <title>Home page</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link href="../css/style.css" rel="stylesheet" type="text/css" media="all"/>
    <link rel="stylesheet" href="../css/bootstrap.min.css"/>
    <style>
        .header_bottom{
            width:430px;
            margin-left: 350px;
            margin-top: 50px;
        }
        .header h1{
            position: relative;
            top:30px;
            left: 350px;
        }
        .menu{
            height: 50px;
        }
        .category_table th{
            text-align: center;
            font-weight: bold;
            font-size: 20px;
        }
        .title_category{
            font-weight: bold;
            position: relative;

        }
        .category_add {

        }
        .my_alert{
            width:220px;
        }
    </style>
</head>
<body>


<div class="wrap">

    <div class="header">
        <h1>>>>>Pages on the site:<<<<</h1>
        <div class="header_bottom">
            <div class="menu">
                <ul>
                    <li class="active"><a href="Admin.php">Home</a></li>
                    <li ><a href="Product.php">Products</a></li>
                    <li><a href="News.php">News</a></li>
                    <li><a href="Contact.php">Contact</a></li>
                    <div class="clear"></div>
                </ul>
            </div>

            <div class="clear"></div>
        </div>
 </div>

    <div class="admin_panel" ng-controller="AdminCtrl">
        <div class="container">
            <div class="row">
               <div class="col-lg-5">
                   <h1>List categories:</h1>
                   <div class="alert alert-success my_alert" ng-if="enableSuccess == true">
                       <a  class="alert-link">Success! Data is Save.</a>
                   </div>
                   <a href="" ng-click="ShowAddCategory()" class="btn btn-success">Add category</a>
                   <table ng-if="enableAddCategory == true" class="category_add table table-striped">
                       <tr>
                           <td class="title_category">Title category: </td>
                           <td><input type="text" class="form-control" ng-model="New_Category" /></td>
                           <td><a class="btn btn-success" ng-click="AddCategory(New_Category)">Save category</a></td>
                       </tr>
                   </table>
                   <table class="table table-striped category_table">
                       <thead>
                       <tr>
                           <th class="test">#</th>
                           <th>Title</th>
                           <th></th>
                           <th></th>
                           <th></th>
                       </tr>
                       </thead>
                       <tbody>
                       <tr ng-repeat="category in Categories track by $index">
                           <th scope="row"><input type="text" class="form-control" value="{{category.Id}}" disabled /> </th>
                           <td><input class="form-control" type="text"  ng-disabled="enableCategory!=$index" ng-model="category.Title" /></td>
                           <td><a ng-click="DeleteCategory(category)" class="btn btn-success" style="cursor: pointer">Delete</a></td>
                           <td><a ng-hide="enableCategory == $index"  ng-click="editCategory($index)" class="btn btn-success" style="cursor: pointer">Edit</a>
                               <a ng-show="enableCategory == $index" ng-click="saveCategory(category)" class="btn btn-success" style="cursor: pointer">Save</a>
                           </td>
                       </tr>

                       </tbody>
                   </table>

                   <h1>Our telephone:</h1>
                   <table class="table table-striped category_table">
                       <thead>
                       <tr>
                           <th class="test">#</th>
                           <th>Telephone</th>
                           <th></th>
                           <th></th>
                           <th></th>
                       </tr>
                       </thead>
                       <tbody>
                       <tr ng-repeat="telephone in OtherInfo track by $index">
                           <th scope="row"><input type="text" class="form-control" value="{{telephone.Id}}" disabled /> </th>
                           <td><input class="form-control" type="text"  ng-disabled="enableTel!=$index" ng-model="telephone.Telephone" /></td>
                           <td><a ng-hide="enableTel == $index"  ng-click="editTelephone($index)" class="btn btn-success" style="cursor: pointer">Edit</a>
                               <a ng-show="enableTel == $index" ng-click="saveTelephone(telephone)" class="btn btn-success" style="cursor: pointer">Save</a>
                           </td>
                       </tr>

                       </tbody>
                   </table>


                   <h1>Slider products:</h1>
                   <table class="table table-striped category_table">
                       <thead>
                       <tr>
                           <th class="test">#</th>
                           <th>Slider</th>
                           <th></th>
                           <th></th>
                           <th></th>
                       </tr>
                       </thead>
                       <tbody>
                       <tr ng-repeat="slide in slides track by $index">
                           <th scope="row"><input type="text" class="form-control" value="{{slide.Id}}" disabled /> </th>
                           <td><input class="form-control" type="text"  ng-disabled="enableTel!=$index" ng-model="slide.Title" /></td>
                           <td>
                               <a   ng-click="removeSlide(slide)" class="btn btn-danger" style="cursor: pointer">Remove</a>
                           </td>
                       </tr>

                       </tbody>
                   </table>



               </div>
            </div>
        </div>
    </div>

    <script type="text/javascript" src="../js/jquery-2.1.3.min.js"></script>
    <script type="text/javascript" src="../js/angular.js"></script>
    <script type="text/javascript" src="/js/AngularControllers/AdminCtrl.js"></script>
    <script type="text/javascript" src="/js/AngularControllers/SliderCtrl.js"></script>
    <script type="text/javascript" src="/js/AngularControllers/ReadMoreCtrl.js"></script>
    <script type="text/javascript" src="/js/angularModules/mainModule.js"></script>
</body>
</html>

